<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateIntegralsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('integrals', function (Blueprint $table) {
            $table->id();
            $table->string('name',200)->comment('兑换商品名称');
            $table->integer('integral')->comment('兑换此商品需要的积分');
            $table->tinyInteger('num')->comment('剩余数量');
            $table->tinyInteger('status')->default('1')->comment('积分商品状态 1：可兑换 0：不可兑换');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('integrals');
    }
}
